﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VanTaiProperty;
using VanTaiData;
using VanTaiBLL;
using Roles;
namespace VanTaiTMS.Page
{
    public partial class Site : System.Web.UI.MasterPage
    {
        #region[Define]
        protected string StrAlert = "";
        private DataTable dtCookies;
        private clsBusiness_tb_Cookies clsCookies = new clsBusiness_tb_Cookies();
        #endregion

        #region[Controller]
        protected void Page_Load(object sender, EventArgs e)
        {
            SetPermisstion_Page();
            SetCurrentPage();
            HttpCookie cookie = Request.Cookies["UserLogin"];
            dtCookies = clsCookies.GetCookies();
            if (cookie != null)
            {
                if (cookie.Values["UserName"] != null && cookie["Users_ID"] != null && cookie["RolesID"] !=null)
                {
                    StrAlert = cookie.Values["UserName"].ToString();

                }
            }
            else
            {
                Response.Redirect("dang-nhap.aspx");
            }
        }
        protected void lnkLogout_Click(object sender, EventArgs e)
        {
            UpdateStatusUser();
            DeleteCookies();
            HttpCookie cookie = Request.Cookies["UserLogin"];
            cookie.Expires = DateTime.Now.AddDays(-1);
            Response.Cookies.Add(cookie);
            Response.Redirect("dang-nhap.aspx", true);
        }
        #endregion

        #region[Function]
        protected void UpdateStatusUser()
        {
            HttpCookie cookie = Request.Cookies["UserLogin"];
            VanTaiProperty.clsTMUserProperty obj = new clsTMUserProperty();
            obj.Users_ID = int.Parse(cookie["Users_ID"]);
            obj.bitSys = false;
            VanTaiBLL.clsBusiness_TM_Usercs.UpdateStatusUser(obj);
        }
        protected void DeleteCookies()
        {
            VanTaiBLL.clsBusiness_tb_Cookies.DeleteCookies();
        }
        #endregion

        #region[SetPage]
        private void SetCurrentPage()
        {
            var pageName = GetPageName();

            switch (pageName)
            {
                case "Default.aspx":
                    DanhDiaDanh.Attributes["class"] = "nav nav-list collapse in";
                    break;
                //Danh mục địa danh
                case "quanhuyen.aspx":
                    DanhDiaDanh.Attributes["class"] = "nav nav-list collapse in";
                    QuanHuyen.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "quoc-gia.aspx":
                    DanhDiaDanh.Attributes["class"] = "collapse in";
                    QuocGia.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "tinh.aspx":
                    DanhDiaDanh.Attributes["class"] = "nav nav-list collapse in";
                    TinhThanh.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "mien.aspx":
                    DanhDiaDanh.Attributes["class"] = "nav nav-list collapse in";
                    Mien.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Kết thúc-------------
                //Danh mục quản lý
                case "danh-sach-xe.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    Xe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "nhom-xe.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    NhomXe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "nhan-vien.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    NhanVien.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;


                case "noi-giao-hang.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    NoiGiaoHang.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "khach-hang.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    KhachHang.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "dich-vu-boc-xep.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    DichVuBocXep.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "danh-muc-khoan.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    QuanLyCaBin.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //------------Quản-Lý-Hợp-Đồng------

                case "loai-hop-dong.aspx":
                    DanhMucQuanLyHopDong.Attributes["class"] = "nav nav-list collapse in";
                    LoaiHopDong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "lap-hop-dong.aspx":
                    DanhMucQuanLyHopDong.Attributes["class"] = "nav nav-list collapse in";
                    LapHopDong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Kết thúc-------------
                //Danh mục cơ cấu
                case "khoi.aspx":
                    DanhMucCoCau.Attributes["class"] = "nav nav-list collapse in";
                    Khoi.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "phong-ban.aspx":
                    DanhMucCoCau.Attributes["class"] = "nav nav-list collapse in";
                    PhongBan.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Kết thúc-------------
                //Danh mục khác
                case "dan-toc.aspx":
                    DanhMucKhac.Attributes["class"] = "nav nav-list collapse in";
                    DanToc.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "tien-te.aspx":
                    DanhMucKhac.Attributes["class"] = "nav nav-list collapse in";
                    TienTe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "ton-giao.aspx":
                    DanhMucKhac.Attributes["class"] = "nav nav-list collapse in";
                    TonGiao.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "don-vi-tinh.aspx":
                    DanhMucKhac.Attributes["class"] = "nav nav-list collapse in";
                    DonViTinh.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Hàng-Hoá-------------
                case "quan-ly-hang-hoa.aspx":
                    QuanLyHangHoa.Attributes["class"] = "nav nav-list collapse in";
                    HangHoa.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "chi-tiet-hang-hoa.aspx":
                    QuanLyHangHoa.Attributes["class"] = "nav nav-list collapse in";
                    ChiTietHangHoa.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "nhat-ky-hang-hoa.aspx":
                    QuanLyHangHoa.Attributes["class"] = "nav nav-list collapse in";
                    NhatKyHangHoa.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Kết thúc-------------
                //Danh mục quan ly
                case "loai-xe.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    LoaiXe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "don-vi-tinh-loai-xe.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    DonViTinhLoaiXe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "trong-tai.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    TrongTai.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "danh-muc-xe.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    Xe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "thong-tin-xe-ra-vao.aspx":
                    DanhMucQuanLy.Attributes["class"] = "nav nav-list collapse in";
                    ThongTinXeRaVaoCong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                //Quản lý sữa chữa - thay thế
                case "linh-vuc.aspx":
                    QuanLySuaChuaThayThe.Attributes["class"] = "nav nav-list collapse in";
                    TenSuaChuaThayThe.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "loai-du-an.aspx":
                    QuanLySuaChuaThayThe.Attributes["class"] = "nav nav-list collapse in";
                    KyHieuLoaiVatTu.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "de-nghi-sua-chua.aspx":
                    QuanLySuaChuaThayThe.Attributes["class"] = "nav nav-list collapse in";
                    DeNghiSuaChua.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                //Quản lý doanh thu chi phí
                case "ke-hoach-dieu-dong.aspx":
                    QuanLyDoanhThuChiPhiXe.Attributes["class"] = "nav nav-list collapse in";
                    KeHoachDieuDong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "lenh-dieu-dong.aspx":
                    QuanLyDoanhThuChiPhiXe.Attributes["class"] = "nav nav-list collapse in";
                    LenhDieuDong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "chi-tiet-lenh-dieu-dong.aspx":
                    QuanLyDoanhThuChiPhiXe.Attributes["class"] = "nav nav-list collapse in";
                    ChiTietLenhDieuDong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "bao-cao-doanh-thu.aspx":
                    QuanLyDoanhThuChiPhiXe.Attributes["class"] = "nav nav-list collapse in";
                    BaoCaoDoanhThuChiPhi.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "nhat-ky-hanh-trinh.aspx":
                    QuanLyDoanhThuChiPhiXe.Attributes["class"] = "nav nav-list collapse in";
                    NhatKyHanhTrinh.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "nhat-ky-dieu-dong.aspx":
                    QuanLyDoanhThuChiPhiXe.Attributes["class"] = "nav nav-list collapse in";
                    NhatKyDieuDong.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Kết thúc-------------
                //Hệ thống
                case "quan-ly-tai-khoan.aspx":
                    QuanLyHeThong.Attributes["class"] = "nav nav-list collapse in";
                    TaiKhoanNguoiDung.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "quan-ly-nhom-quyen.aspx":
                    QuanLyHeThong.Attributes["class"] = "nav nav-list collapse in";
                    NhomQuyen.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;

                case "quan-ly-quyen.aspx":
                    QuanLyHeThong.Attributes["class"] = "nav nav-list collapse in";
                    PhanQuyen.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                case "cau-hinh-mail.aspx":
                    QuanLyHeThong.Attributes["class"] = "nav nav-list collapse in";
                    CauHinhMail.Attributes["style"] = "font-style:italic;font-weight:bold";
                    break;
                //-------------Kết thúc-------------
            }
        }
        private string GetPageName()
        {
            return Request.Url.ToString().Split('/').Last();
        }
        #endregion

        #region[SetPermisstionPage]
        protected void SetPermisstion_Page()
        {
            HttpCookie cookie = Request.Cookies["UserLogin"];
            if (cookie != null)
            {
                #region[DanhMucCha]
                bool Is_Page_DanhMucDiaDanh = SecurityServices.HasPermisstionPage(StringContent.DanhMucDiaDanh, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucDiaDanh == false)
                {
                    DMDiaDanh.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucQuanLy = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLy, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucQuanLy == false)
                {
                    DMQuanLy.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucQuanLyHopDong = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLyHopDong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucQuanLyHopDong == false)
                {
                    DMQuanLyHopDong.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucCoCau = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLyCoCau, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucCoCau == false)
                {
                    DMCoCau.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucKhac = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLyKhac, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucKhac == false)
                {
                    DMKhac.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucHangHoa = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLyHangHoa, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucHangHoa == false)
                {
                    DMHangHoa.Attributes["style"] = "display:none";
                }

                bool Is_Page_QuanLySuaChuaThayThe = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLySuaChuaThayThe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanLySuaChuaThayThe == false)
                {
                    DMQuanLySuaChuaThayThe.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucQuanLyDoanhThu = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLyDoanhThu, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucQuanLyDoanhThu == false)
                {
                    DMQuanLyDoanhThuChiPhiXe.Attributes["style"] = "display:none";
                }

                bool Is_Page_HeThong = SecurityServices.HasPermisstionPage(StringContent.DanhMucQuanLyHeThong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_HeThong == false)
                {
                    DMQuanLyHeThong.Attributes["style"] = "display:none";
                }
                #endregion

                #region[DanhMucCon]
                bool Is_Page_QuanLyQuocGia = SecurityServices.HasPermisstionPage(StringContent.QuanLyQuocGia, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanLyQuocGia == false)
                {
                    QuocGia.Attributes["style"] = "display:none";
                }

                bool Is_Page_QuanLyMien = SecurityServices.HasPermisstionPage(StringContent.QuanLyMien, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanLyMien == false)
                {
                    Mien.Attributes["style"] = "display:none";
                }

                bool Is_Page_TinhThanh = SecurityServices.HasPermisstionPage(StringContent.QuanLyTinh, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_TinhThanh == false)
                {
                    TinhThanh.Attributes["style"] = "display:none";
                }

                bool Is_Page_QuanHuyen = SecurityServices.HasPermisstionPage(StringContent.QuanLyQuanHuyen, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanHuyen == false)
                {
                    QuanHuyen.Attributes["style"] = "display:none";
                }

                bool Is_Page_LoaiXe = SecurityServices.HasPermisstionPage(StringContent.QuanLyLoaiXe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_LoaiXe == false)
                {
                    LoaiXe.Attributes["style"] = "display:none";
                }

                bool Is_Page_DonViTinhXe = SecurityServices.HasPermisstionPage(StringContent.QuanLyDonViTinhLoaiXe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DonViTinhXe == false)
                {
                    DonViTinhLoaiXe.Attributes["style"] = "display:none";
                }

                bool Is_Page_TrongTaiXe = SecurityServices.HasPermisstionPage(StringContent.QuanLyDonTrongTaiXe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_TrongTaiXe == false)
                {
                    TrongTai.Attributes["style"] = "display:none";
                }

                bool Is_Page_Xe = SecurityServices.HasPermisstionPage(StringContent.QuanLyDanhMucXe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_Xe == false)
                {
                    Xe.Attributes["style"] = "display:none";
                }

                bool Is_Page_NhomXe = SecurityServices.HasPermisstionPage(StringContent.QuanLyDanhMucNhomXe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_NhomXe == false)
                {
                    NhomXe.Attributes["style"] = "display:none";
                }

                bool Is_Page_NhanVien = SecurityServices.HasPermisstionPage(StringContent.QuanLyDanhMucNhanVien, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_NhanVien == false)
                {
                    NhanVien.Attributes["style"] = "display:none";
                }

                bool Is_Page_NoiGiaoHang = SecurityServices.HasPermisstionPage(StringContent.QuanLyDanhNoiGiaoHang, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_NoiGiaoHang == false)
                {
                    NoiGiaoHang.Attributes["style"] = "display:none";
                }

                bool Is_Page_KhachHang = SecurityServices.HasPermisstionPage(StringContent.QuanLyDanhKhachHang, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_KhachHang == false)
                {
                    KhachHang.Attributes["style"] = "display:none";
                }

                bool Is_Page_ThongTinXeRaVao = SecurityServices.HasPermisstionPage(StringContent.QuanLyThongTinXeRaVaoCong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_ThongTinXeRaVao == false)
                {
                    ThongTinXeRaVaoCong.Attributes["style"] = "display:none";
                }

                bool Is_Page_DanhMucLoaiHopDong = SecurityServices.HasPermisstionPage(StringContent.QuanLyLoaiHopDong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DanhMucLoaiHopDong == false)
                {
                    LoaiHopDong.Attributes["style"] = "display:none";
                }

                bool Is_Page_QuanLyHopDong = SecurityServices.HasPermisstionPage(StringContent.QuanLyHopDong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanLyHopDong == false)
                {
                    LapHopDong.Attributes["style"] = "display:none";
                }

                bool Is_Page_Khoi = SecurityServices.HasPermisstionPage(StringContent.QuanLyKhoi, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_Khoi == false)
                {
                    Khoi.Attributes["style"] = "display:none";
                }

                bool Is_Page_PhongBan = SecurityServices.HasPermisstionPage(StringContent.QuanLyPhongBan, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_PhongBan == false)
                {
                    PhongBan.Attributes["style"] = "display:none";
                }

                bool Is_Page_DonToc = SecurityServices.HasPermisstionPage(StringContent.QuanLyDanToc, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DonToc == false)
                {
                    DanToc.Attributes["style"] = "display:none";
                }

                bool Is_Page_TienTe = SecurityServices.HasPermisstionPage(StringContent.QuanLyTienTe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_TienTe == false)
                {
                    TienTe.Attributes["style"] = "display:none";
                }

                bool Is_Page_TonGiao = SecurityServices.HasPermisstionPage(StringContent.QuanLyTonGiao, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_TonGiao == false)
                {
                    TonGiao.Attributes["style"] = "display:none";
                }

                bool Is_Page_DonViTinh = SecurityServices.HasPermisstionPage(StringContent.QuanLyDonViTinh, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_DonViTinh == false)
                {
                    DonViTinh.Attributes["style"] = "display:none";
                }

                bool Is_Page_HangHoa = SecurityServices.HasPermisstionPage(StringContent.QuanLyHangHoa, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_HangHoa == false)
                {
                    HangHoa.Attributes["style"] = "display:none";
                }

                bool Is_Page_CTHangHoa = SecurityServices.HasPermisstionPage(StringContent.QuanLyCTHangHoa, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_CTHangHoa == false)
                {
                    ChiTietHangHoa.Attributes["style"] = "display:none";
                }

                bool Is_Page_SuaChuaThayThe = SecurityServices.HasPermisstionPage(StringContent.QuanLySuaChuaThayThe, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_SuaChuaThayThe == false)
                {
                    DeNghiSuaChua.Attributes["style"] = "display:none";
                }

                bool Is_Page_LinhVuc = SecurityServices.HasPermisstionPage(StringContent.QuanLyLinhVuc, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_LinhVuc == false)
                {
                    TenSuaChuaThayThe.Attributes["style"] = "display:none";
                }

                bool Is_Page_LoaiDuAn = SecurityServices.HasPermisstionPage(StringContent.QuanLyLoaiDuAn, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_LoaiDuAn == false)
                {
                    KyHieuLoaiVatTu.Attributes["style"] = "display:none";
                }

                bool Is_Page_KeHoachDieuDong = SecurityServices.HasPermisstionPage(StringContent.QuanLyKeHoachDieuDong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_KeHoachDieuDong == false)
                {
                    KeHoachDieuDong.Attributes["style"] = "display:none";
                }

                bool Is_Page_BaoCaoDoanhThuChiPhi = SecurityServices.HasPermisstionPage(StringContent.QuanLyDoanhThuChiPhi, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_BaoCaoDoanhThuChiPhi == false)
                {
                    BaoCaoDoanhThuChiPhi.Attributes["style"] = "display:none";
                }

                bool Is_Page_QuanLyDoanhThuChiPhiXe = SecurityServices.HasPermisstionPage(StringContent.QuanLyLenhDieuDong, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanLyDoanhThuChiPhiXe == false)
                {
                    LenhDieuDong.Attributes["style"] = "display:none";
                }

                bool Is_Page_NhatKyHanhTrinh = SecurityServices.HasPermisstionPage(StringContent.QuanLyNhatKyHanhTrinh, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_NhatKyHanhTrinh == false)
                {
                    NhatKyHanhTrinh.Attributes["style"] = "display:none";
                }

                bool Is_Page_QuanLyTaiKhoan = SecurityServices.HasPermisstionPage(StringContent.QuanLyTaiKhoan, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_QuanLyTaiKhoan == false)
                {
                    TaiKhoanNguoiDung.Attributes["style"] = "display:none";
                }

                bool Is_Page_NhomQuyen = SecurityServices.HasPermisstionPage(StringContent.QuanLyNhomQuyen, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_NhomQuyen == false)
                {
                    NhomQuyen.Attributes["style"] = "display:none";
                }
                bool Is_Page_PhanQuyen = SecurityServices.HasPermisstionPage(StringContent.QuanLyPhanQuyen, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_PhanQuyen == false)
                {
                    PhanQuyen.Attributes["style"] = "display:none";
                }
                bool Is_Page_CauHinhMail = SecurityServices.HasPermisstionPage(StringContent.QuanLyCauHinhMail, int.Parse(cookie["RolesID"]), true);
                if (Is_Page_CauHinhMail == false)
                {
                    CauHinhMail.Attributes["style"] = "display:none";
                }
                #endregion
            }
        }
        #endregion
    }
}